﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleAppB5
{
    class Program
    {
        static void Main(string[] args)
        {
            Random r = new Random();
            double AreaSum = 0;
            List<int> randomList = new List<int>();
            //创建10个随机数， 根据数字创建对应的形状 ： 1圆形 2长方形 3正方形 4三角形
            for(int i = 0; i < 10; i++) { 
                randomList.Add(r.Next(1, 5)); 
            }
            foreach(int i in randomList)
            {
                Graphical grap = Factory.GetGraphical(i);
                AreaSum += grap.CalculateArea();
            }
            Console.WriteLine("面积之和：" + Math.Round( AreaSum,4));
            Console.ReadLine();
        }
    }
}
